<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function fn() {
        let count = 0
        let arr = []
        for (let i = 1; i >= 0; i++) {
          if ((i % 7 === 0 && i % 5 !== 0) || i % 9 === 0) {
            arr.unshift(i)
            count++
          }
          if (count === 23) {
            break
          }
        }
        // 遍历数组，将尾数是8的数据改为对象
        for (let i = 0; i <= arr.length - 1; i++) {
          if (arr[i] % 10 === 8) {
            arr[i] = { number: arr[i] }
          }
        }
        return arr
      }
      console.log(fn())
    </script>
  </body>
</html>
